/*
 * Created by JFormDesigner on Wed Jun 26 14:25:14 CST 2024
 */

package scct.haoyuqing.ui;

import java.awt.*;
import java.awt.event.ActionEvent;
import javax.swing.*;

/**
 * @author Administrator
 */
public class FormMain extends JFrame {
    public FormMain() {
        initComponents();
    }
    //用户管理功能
    private void btnUser(ActionEvent e){
//        System.out.println("btnuser");
        //创建usermanage面板
        PanelUserManger panelUserManger=new PanelUserManger(this);
        //先把已经加载的其他管理面板移除
        panelMain.removeAll();
        //加载用户管理面板
        panelMain.add(panelUserManger,BorderLayout.CENTER);
        //刷新页面
        validate();
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        // Generated using JFormDesigner Evaluation license - hao
        menuBar1 = new JMenuBar();
        menu1 = new JMenu();
        menuItem1 = new JMenuItem();
        menuItem2 = new JMenuItem();
        menuBar2 = new JMenuBar();
        menu2 = new JMenu();
        menuItem4 = new JMenuItem();
        menuItem5 = new JMenuItem();
        menuItem6 = new JMenuItem();
        menuItem7 = new JMenuItem();
        menuBar3 = new JMenuBar();
        menu3 = new JMenu();
        menuItem8 = new JMenuItem();
        toolBar1 = new JToolBar();
        btnUser = new JButton();
        button2 = new JButton();
        button3 = new JButton();
        button5 = new JButton();
        panelMain = new JPanel();

        //======== this ========
        setTitle("\u6c7d\u8f66\u7ba1\u7406\u7cfb\u7edf");
        var contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        //======== menuBar1 ========
        {

            //======== menu1 ========
            {
                menu1.setText("\u7cfb\u7edf");

                //---- menuItem1 ----
                menuItem1.setText("\u7528\u6237\u7ba1\u7406");
                menu1.add(menuItem1);

                //---- menuItem2 ----
                menuItem2.setText("\u9000\u51fa");
                menu1.add(menuItem2);
            }
            menuBar1.add(menu1);

            //======== menuBar2 ========
            {

                //======== menu2 ========
                {
                    menu2.setText("\u7ba1\u7406");

                    //---- menuItem4 ----
                    menuItem4.setText("\u54c1\u724c\u7ba1\u7406");
                    menu2.add(menuItem4);

                    //---- menuItem5 ----
                    menuItem5.setText("\u7c7b\u522b\u7ba1\u7406");
                    menu2.add(menuItem5);

                    //---- menuItem6 ----
                    menuItem6.setText("\u5546\u54c1\u7ba1\u7406");
                    menu2.add(menuItem6);

                    //---- menuItem7 ----
                    menuItem7.setText("\u9500\u552e\u7ba1\u7406");
                    menu2.add(menuItem7);
                }
                menuBar2.add(menu2);
            }
            menuBar1.add(menuBar2);

            //======== menuBar3 ========
            {

                //======== menu3 ========
                {
                    menu3.setText("\u5173\u4e8e");

                    //---- menuItem8 ----
                    menuItem8.setText("\u6211\u7684\u9879\u76ee");
                    menu3.add(menuItem8);
                }
                menuBar3.add(menu3);
            }
            menuBar1.add(menuBar3);
        }
        setJMenuBar(menuBar1);

        //======== toolBar1 ========
        {
            toolBar1.setFloatable(false);

            //---- btnUser ----
            btnUser.setIcon(new ImageIcon(getClass().getResource("/icon/\u7528\u6237.png")));
            btnUser.setToolTipText("\u7528\u6237\u7ba1\u7406");
            btnUser.addActionListener(e -> btnUser(e));
            toolBar1.add(btnUser);

            //---- button2 ----
            button2.setIcon(new ImageIcon(getClass().getResource("/icon/\u7528\u6237.png")));
            button2.setToolTipText("\u7c7b\u522b\u7ba1\u7406");
            toolBar1.add(button2);

            //---- button3 ----
            button3.setIcon(new ImageIcon(getClass().getResource("/icon/\u7528\u6237.png")));
            button3.setToolTipText("\u54c1\u724c\u7ba1\u7406");
            toolBar1.add(button3);

            //---- button5 ----
            button5.setIcon(new ImageIcon(getClass().getResource("/icon/\u7528\u6237.png")));
            button5.setToolTipText("\u5546\u54c1\u7ba1\u7406");
            toolBar1.add(button5);
        }
        contentPane.add(toolBar1, BorderLayout.NORTH);

        //======== panelMain ========
        {
            panelMain.setBackground(new Color(0xf2f2f2));
            panelMain.setBorder (new javax. swing. border. CompoundBorder( new javax .swing .border .TitledBorder (new javax.
            swing. border. EmptyBorder( 0, 0, 0, 0) , "JFor\u006dDesi\u0067ner \u0045valu\u0061tion", javax. swing. border
            . TitledBorder. CENTER, javax. swing. border. TitledBorder. BOTTOM, new java .awt .Font ("Dia\u006cog"
            ,java .awt .Font .BOLD ,12 ), java. awt. Color. red) ,panelMain. getBorder
            ( )) ); panelMain. addPropertyChangeListener (new java. beans. PropertyChangeListener( ){ @Override public void propertyChange (java
            .beans .PropertyChangeEvent e) {if ("bord\u0065r" .equals (e .getPropertyName () )) throw new RuntimeException
            ( ); }} );
            panelMain.setLayout(new BorderLayout());
        }
        contentPane.add(panelMain, BorderLayout.CENTER);
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    // Generated using JFormDesigner Evaluation license - hao
    private JMenuBar menuBar1;
    private JMenu menu1;
    private JMenuItem menuItem1;
    private JMenuItem menuItem2;
    private JMenuBar menuBar2;
    private JMenu menu2;
    private JMenuItem menuItem4;
    private JMenuItem menuItem5;
    private JMenuItem menuItem6;
    private JMenuItem menuItem7;
    private JMenuBar menuBar3;
    private JMenu menu3;
    private JMenuItem menuItem8;
    private JToolBar toolBar1;
    private JButton btnUser;
    private JButton button2;
    private JButton button3;
    private JButton button5;
    private JPanel panelMain;
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
